public class GetPrime {
    public static void main(String[] args) {
        int count = 0;
        int num = 2;
        while (count < 2019) {
            boolean flag = true;
            for (int i = 2; i < (int) Math.sqrt(num) + 1; i++) {
                if (num % i == 0) {
                    flag = false;
                    break;
                }
            }
            if (flag) {
                count ++;
            }
            num ++;
        }
        System.out.println(num - 1);
    }
}
